package com.test.hibernate.test;

import com.test.hibernate.entities.Pay;
import com.test.hibernate.entities.Worker;
import org.junit.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * @author lzy
 * @version v1.0
 * Create DateTime: 2018/9/18 16:40
 */
public class HibernateTest2 extends AbstractTest {
    private static final Logger LOGGER = LoggerFactory.getLogger(HibernateTest2.class);

    @Test
    public void testComponent() {
        Worker worker = new Worker();
        Pay pay = new Pay();
        pay.setMonthlyPay(10000);
        pay.setYearPay(80000);
        pay.setVocationWithPay(5);
        worker.setName("abc");
        worker.setPay(pay);
        session.save(worker);
    }

}
